package com.ts.host;

import com.rio.core.L;
import com.rio.layout.ILayout;
import com.rio.layout.LayoutManager;
import com.rio.layout.PopupManager;
import com.rio.layout.view.SimpleBackground;
import com.rio.utils.DoubleClickHelper;
import com.rio.utils.OnDoubleClickListener;
import com.ts.layout.MainLayout;
import com.ts.manager.MachineManager;
import com.ts.view.QuitDailog;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;


import de.greenrobot.event.EventBus;

public class MainBackground extends SimpleBackground {



	@Override
	public ILayout onAttach() {
		L.i("MainBackground onAttach");

		return new MainLayout();
	}

	@Override
	public void onDetach() {
		L.i("MainBackground onDetach");
		super.onDetach();
	}

	@Override
	public boolean onResume() {
		L.i("MainBackground onResume");
		//启动时关闭阀门
		MachineManager.getInstance().closeLedAndWater();
		return super.onResume();
	}
	
	@Override
	public boolean onPause() {
		L.i("MainBackground onPause");
		//离开时关闭阀门
		MachineManager.getInstance().closeLedAndWater();
		return super.onPause();
	}

	@Override
	public boolean onKeyBackHome() {
			QuitDailog.getInstance().show();
			return true;
	}

	
	@Override
	public boolean onCrashException(Throwable ex) {
		// TODO Auto-generated method stub
		return true;
	}










}
